#-*- encoding: utf-8-*-
'''
Created on 2012-1-10

@author: Botao Wu
'''


class TestTarget:                     # The target object of the parser
    maxDepth = 0
    depth = 0
    def start(self, tag, attrib):   # Called for each opening tag.
        print 'start: ', tag
        self.depth += 1
        if self.depth > self.maxDepth:
            self.maxDepth = self.depth
            
    def end(self, tag):             # Called for each closing tag.
        print 'end: ', tag
        self.depth -= 1
        
    def data(self, data):
        print 'data: ', data.strip()
        pass            # We do not need to do anything with data.
    
    def close(self):    # Called when all data has been parsed.
        return self.maxDepth
    
    


